package com.jawmask.android.stuartproair.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

import com.jawmask.android.stuartproair.R;
import com.jawmask.android.stuartproair.constants.UIUtils;

public class ContactUsActivity extends BaseListActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.list_view_layout, true);
		setTitle(getString(R.string.contact_us_title));

		setListAdapter(new ListItemAdapter(getResources().getStringArray(R.array.contact_us_actions), getResources().getStringArray(
				R.array.contact_us_actions_value)));
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		String contactUsAction = (String) getListAdapter().getItem(position);
		if (contactUsAction.equals(getString(R.string.call))) {
			callCustomerCare();
		} else if (contactUsAction.equals(getString(R.string.email))) {
			UIUtils.getInstance().launchEmailClient(this, getString(R.string.contact_email), "", "", getString(R.string.contact_email_title));
		} else if (contactUsAction.equals(getString(R.string.schedule_an_appointment))) {
			launchSchedulerScreen();
		}
	}
}